<?php

/**
 * This is the model class for table "jumlahayamtelurdaging".
 *
 * The followings are the available columns in table 'jumlahayamtelurdaging':
 * @property integer $jatd_id
 * @property integer $jatd_kec
 * @property integer $jatd_daging_broiler
 * @property integer $jatd_daging_pejantan
 * @property integer $jatd_daging_jumlah
 * @property integer $jatd_telur_jantan
 * @property integer $jatd_telur_betina
 * @property integer $jatd_telur_jumlah
 * @property integer $jatd_tahun
 *
 * The followings are the available model relations:
 * @property Kecamatan $jatdKec
 */
class Jumlahayamtelurdaging extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Jumlahayamtelurdaging the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'jumlahayamtelurdaging';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('jatd_kec, jatd_daging_broiler, jatd_daging_pejantan, jatd_daging_jumlah, jatd_telur_jantan, jatd_telur_betina, jatd_telur_jumlah, jatd_tahun', 'numerical', 'integerOnly'=>true),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('jatd_id, jatd_kec, jatd_daging_broiler, jatd_daging_pejantan, jatd_daging_jumlah, jatd_telur_jantan, jatd_telur_betina, jatd_telur_jumlah, jatd_tahun', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
			'jatdKec' => array(self::BELONGS_TO, 'Kecamatan', 'jatd_kec'),
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'jatd_id' => 'Jatd',
			'jatd_kec' => 'Jatd Kec',
			'jatd_daging_broiler' => 'Ayam Ras Daging Broiler',
			'jatd_daging_pejantan' => 'Ayam Ras Daging Pejantan',
			'jatd_daging_jumlah' => 'Jumlah Ayam Ras Daging',
			'jatd_telur_jantan' => 'Ayam Ras Telur Jantan',
			'jatd_telur_betina' => 'Ayam Ras Telur Betina',
			'jatd_telur_jumlah' => 'Jumlah Ayam Ras Telur',
			'jatd_tahun' => 'Tahun',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('jatd_id',$this->jatd_id);
		$criteria->compare('jatd_kec',$this->jatd_kec);
		$criteria->compare('jatd_daging_broiler',$this->jatd_daging_broiler);
		$criteria->compare('jatd_daging_pejantan',$this->jatd_daging_pejantan);
		$criteria->compare('jatd_daging_jumlah',$this->jatd_daging_jumlah);
		$criteria->compare('jatd_telur_jantan',$this->jatd_telur_jantan);
		$criteria->compare('jatd_telur_betina',$this->jatd_telur_betina);
		$criteria->compare('jatd_telur_jumlah',$this->jatd_telur_jumlah);
		$criteria->compare('jatd_tahun',$this->jatd_tahun);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}